<title>备份数据库 - QAdmin后台模板</title>

<body>

<div id="app2">
    <table class="layui-table layui-form">
        <colgroup>
            <col width="50">
            <col width="300">
            <col width="300">
            <col width="200">
            <col width="200">
            <col width="200">
            <col width="100">
            <col width="300">
            <col width="150">
            <col width="100">
        </colgroup>
        <thead>
        <tr>
            <th><input lay-filter="all" type="checkbox" lay-skin="primary"></th>
            <th>表名</th>
            <th>表说明</th>
            <th>引擎</th>
            <th>编码</th>
            <th>数据量</th>
            <th>数据大小</th>
            <th>创建时间</th>
            <th>备份状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="0" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_admin</td>
            <td>管理员表</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>0</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:49</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_admin&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="1" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_article</td>
            <td>文章表</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>9</td>
            <td>80KB</td>
            <td>2018-04-23 00:08:49</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_article&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="2" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_category</td>
            <td>文章栏目</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>15</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:49</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_category&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="3" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_flink</td>
            <td>友情链接</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>5</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:50</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_flink&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="4" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_info</td>
            <td>个人资料</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>19</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_info&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="5" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_keys</td>
            <td>TAG表</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>26</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:52</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_keys&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="6" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_leave</td>
            <td>留言表</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>60</td>
            <td>16KB</td>
            <td>2018-04-28 12:42:22</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_leave&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="7" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_menu</td>
            <td>后台菜单</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>51</td>
            <td>48KB</td>
            <td>2018-04-23 00:08:52</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_menu&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="8" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_nav</td>
            <td>前台导航</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>5</td>
            <td>16KB</td>
            <td>2018-04-23 00:08:54</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_nav&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="9" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_region</td>
            <td>城市地区</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3461</td>
            <td>336KB</td>
            <td>2018-04-23 00:08:54</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_region&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="10" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_skills</td>
            <td>专业技能</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>66</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:50</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_skills&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="11" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_user</td>
            <td>用户表</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>11</td>
            <td>16KB</td>
            <td>2018-04-28 12:44:59</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_user&amp;dir=20190401_2718">备份</a></td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_work</td>
            <td>工作经历</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>

        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>

        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>

        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>


        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>


        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>

        <tr>
            <td><input type="checkbox" lay-filter="vo" data-id="12" lay-skin="primary" value="false">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>
            </td>
            <td>qadmin_xxxx</td>
            <td>xxxx</td>
            <td>InnoDB</td>
            <td>utf8_general_ci</td>
            <td>3</td>
            <td>16KB</td>
            <td>2018-04-23 00:09:51</td>
            <td>未备份</td>
            <td><a href="#/backup.html?table=qadmin_work&amp;dir=20190401_2718">备份</a></td>
        </tr>


        </tbody>

        <tfoot>

        <tr>
            <td colspan="99">
                <input type="checkbox" lay-filter="single"  lay-skin="primary">
                &nbsp;&nbsp;&nbsp;&nbsp;所有表合并成一个文件
                <a href="javascript:;" style="float: right;"  class="layui-btn layui-btn-normal">自动备份</a>
                <a href="javascript:;" style="float: right;  margin-right: 20px;"  class="layui-btn">一键备份</a>
            </td>
        </tr>

        </tfoot>
    </table>


</div>
</body>
<script>

layui.use('form', function() {
    const form = layui.form; const layer = layui.layer; const $ = layui.jquery;
    form.on('checkbox(all)', function(data) {
        for (let i = 0; i < vue.list.length; i++) {
            vue.list[i].Selected = data.elem.checked;
        }
        setTimeout(function() {
            form.render();
        }, 5);
    });

    form.on('checkbox(vo)', function(data) {
        const id = $(data.elem).attr('data-id');
        for (let i = 0; i < vue.list.length; i++) {
            if (i == id) {
                vue.list[i].Selected = data.elem.checked;
            }
        }
    });

    form.on('checkbox(single)', function(data) {
        vue.single = data.elem.checked;
    });

    form.on('switch(state)', function(data) {
        const id = $(data.elem).attr('data-id');
        $.ajax({
            url: '/admin/mysql/state.html',
            data: {
                id: id,
            },
            type: 'get',
            dataType: 'json',
            success: function(e) {
                if (e.code == 1) {
                    layer.msg(e.msg, {
                        icon: 1,
                    });
                } else {
                    layer.msg(e.msg, {
                        icon: 2,
                        shade: 0.5,
                        time: 2000,
                        shadeClose: true,
                    });
                }
            },
        });
    });
});
</script>

